namespace Reportes.Logistica.Reportes
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;

    /// <summary>
    /// Summary description for RptContabilidadStock.
    /// </summary>
    public partial class RptContabilidadStock : Telerik.Reporting.Report
    {
        public RptContabilidadStock()
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        public void OrdenarWebaditas(int vl_orden)
        {
            if (vl_orden==1)
            {
                this.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
            new Telerik.Reporting.Data.Sorting("=Fields.CODIGO", Telerik.Reporting.Data.SortDirection.Asc)});

            }
            else if (vl_orden==2)
            {
                this.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
            new Telerik.Reporting.Data.Sorting("=Fields.PRONOMBRECOMERCIAL", Telerik.Reporting.Data.SortDirection.Asc)});
            }
            else if (vl_orden == 3)
            {
                this.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
            new Telerik.Reporting.Data.Sorting("=Fields.IMPORTE", Telerik.Reporting.Data.SortDirection.Asc)});
            }
            else if (vl_orden == 4)
            {
                this.Sortings.AddRange(new Telerik.Reporting.Data.Sorting[] {
            new Telerik.Reporting.Data.Sorting("=Fields.IMPORTE", Telerik.Reporting.Data.SortDirection.Desc)});
            }
        }

        public void AddItems(String VL_FECHA, String Empresa, String VL_TipoExistencia, String VL_RUC)
        {
            this.titleTextBox.Value = this.titleTextBox.Value.ToString() +  VL_FECHA;
            this.textBox2.Value = this.textBox2.Value.ToString() + Empresa;
            this.textBox7.Value = this.textBox7.Value.ToString() + VL_TipoExistencia;
            this.textBox8.Value = VL_RUC;
        }

        public void RestriccionPermiso(int VL_PERMISO)
        {
            if (VL_PERMISO != 1)
            {
                this.textBox5.Visible = false;
                this.textBox4.Visible = false;
                this.iMPORTECaptionTextBox.Visible = false;
                this.iMPORTEDataTextBox.Visible = false;
                this.textBox3.Visible = false;
                this.textBox6.Visible = false;
            }
        }
    }
}